﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;

namespace SquareChaseBot
{
    /// <summary>
    /// Cursor API functions.
    /// </summary>
    internal static class Cursor
    {
        #region Methods

        /// <summary>
        /// Moves the cursor to the specified screen coordinates. If the new 
        /// coordinates are not within the screen rectangle set by the most
        /// recent ClipCursor function call, the system automatically adjusts 
        /// the coordinates so that the cursor stays within the rectangle. 
        /// </summary>
        /// <param name="X">
        /// The new x-coordinate of the cursor, in screen coordinates. 
        /// </param>
        /// <param name="Y">
        /// The new y-coordinate of the cursor, in screen coordinates. </param>
        /// <returns>
        /// Returns nonzero if successful or zero otherwise. To get extended 
        /// error information, call GetLastError.
        /// </returns>
        /// <remarks>
        /// Ref: http://msdn.microsoft.com/en-us/library/windows/desktop/ms648394%28v=vs.85%29.aspx
        /// Ref: http://www.pinvoke.net/default.aspx/user32.setcursorpos
        /// </remarks>
        [DllImport("user32.dll")]
        internal static extern bool SetCursorPos(int X, int Y);
        
        #endregion
    }
}
